<!DOCTYPE html>
<html>

<head>
    <title>用户管理</title>
    <!--#include file="common/head.html" -->
</head>

<body class="inner-page">
    <h2>用户管理</h2>

    <div id="vue">
        <admintable api-url="/iam_api/common_api/user">
            <template v-slot="slotProps">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>用户名称</th>
                        <th>性别</th>
                        <th>出生日期</th>
                        <th>头像</th>
                        <th>注册日期</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tr v-for="(item) in slotProps.list">
                    <td>{{item.id}}</td>
                    <td>
                        <span v-show="slotProps.data.editingId != item.id">{{item.loginId}}</span>
                        <input type="text" v-show="slotProps.data.editingId == item.id" v-model="item.loginId" />
                    </td>
                    <td>
                        <span v-show="slotProps.data.editingId != item.id">{{item.gender}}</span>
                        <input type="text" v-show="slotProps.data.editingId == item.id" v-model="item.gender" />
                    </td>
                    <td>
                        <span v-show="slotProps.data.editingId != item.id">{{item.birthday}}</span>
                        <input type="text" v-show="slotProps.data.editingId == item.id" v-model="item.birthday" />
                    </td>
                    <td>
                        <span v-show="slotProps.data.editingId != item.id">{{item.content}}</span>
                        <input type="text" v-show="slotProps.data.editingId == item.id" v-model="item.content" />
                    </td>
                    <td>
                        <admintable-date-column :item="item" />
                    </td>
                    <td>
                        <span v-show="slotProps.data.editingId != item.id">{{slotProps.data.STAT[item.stat]}}</span>

                        <select v-show="slotProps.data.editingId == item.id" v-model="item.stat" v-model="item.stat"
                            style="width:80px">
                            <option value="0">正常</option>
                            <option value="1">已禁用</option>
                            <option value="2">已删除</option>
                        </select>
                    </td>

                    <td>
                        <admintable-date-edit-btns :item="item" :data="slotProps.data" />
                    </td>
                </tr>

                <tr :class="{hide: !slotProps.data.isShowCreate}">
                    <td></td>
                    <td><input type="text" v-model="slotProps.data.create.name" placeholder="租户名称" /></td>
                    <td>
                        <input type="text" v-model="slotProps.data.create.code" placeholder="租户编码" />
                        <!--       <select v-model="create.objGroup">
                        <option v-for="(k, v) in OBJECT_GROUP" :value="v">
                            {{k}}-{{v}}
                        </option>
                    </select> -->
                    </td>
                    <td><input type="text" v-model="slotProps.data.create.content" placeholder="租户简介" /></td>
                    <td></td>
                    <td></td>

                    <!--         <td>
                        <select v-model="create.combatParty" style="width:80px">
                            <option value="1">红方-1</option>
                            <option value="2">蓝方-2</option>
                            <option value="3">中立（如红十字会医院等）-3</option>
                            <option value="4">情报（针对拍摄的图片）-4</option>
                        </select>
                    </td>
                    <td>
                        <input type="text" v-model="create.objTypeImg" placeholder="对象类型图标" style="width:150px" />
                    </td>
                    <td>
                        <input type="number" v-model="create.objTypeNum" placeholder="对象类型预设数量" style="width:50px" />
                    </td> -->
                    <td>
                        <a href="#" @click="$children[0].doCreate">新增</a> | <a href="#"
                            @click="slotProps.data.isShowCreate = false">取消</a>
                    </td>
                </tr>
            </template>
        </admintable>
    </div>

    <script src="common/component.js"></script>
    <script>
        new Vue({
            el: '#vue'
        });
    </script>
</body>

</html>